﻿{% extends "gma/base.html" %}

<!-- CONTENT
  =====================================================================-->

{% block content %}

<div class="page__hd">
    <h1 class="page__title">
        <i class="fa fa-broadcast-tower weui_grid_icon_fa" style="font-size: 32px"> </i> 测试textarea
    </h1>
    <p>
        {{ short_url }}
    </p>
</div>

<div class="page__bd">
    <div class="weui-cells__title">消息内容</div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <textarea class="weui-textarea" id="push_message" placeholder="请输入要消息内容" rows="10"></textarea>
            </div>
        </div>
    </div>
</div>

<div class="weui-btn-area">
    <a class="weui-btn weui-btn_block weui-btn_primary" href="javascript:pushMessage()"> <i class="fa fa-bullhorn"></i> 测试点击 </a>
</div>

<div class="page__ft">
    <a href="{% url 'gma:home' %}">
        <span class="bottom-logo">
           HiBao
       </span>
    </a>
</div>

{% endblock content %}

<!-- SCRIPT
  =====================================================================-->

{% block extra_js %}
<script>

function pushMessage() {
    const message = $('#push_message').val();
    if (!message) {
        alert("内容不可以为空！");
        return;
    }

    // 编辑消息时，页面会自动滚动，导致弹框无法被点击
    document.activeElement.scrollIntoViewIfNeeded();
    title = document.activeElement.tagName;
    show_confirm_dialog('title', title, ()=> {
        show_toast(`hello`);

         show_confirm_dialog('测试', 'hello?', ()=> {
            show_toast(`hello`);
        });
    });
}

</script>
{% endblock extra_js %}